<html>
<head><meta charset="utf-8"><title>Expr within expr · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Expr.20within.20expr.html">Expr within expr</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="198597615"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Expr%20within%20expr/near/198597615" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Paul Faria <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Expr.20within.20expr.html#198597615">(May 24 2020 at 20:02)</a>:</h4>
<p>Is there an existing pattern for determining if one expr is within another? I'm specifically trying to track whether an unsafe expression (I already have tracking for these in my PR) exists within an unsafe block (I've been adding support for this as another variant in <code>ra_hir_def/src/expr.rs:Expr</code>). Currently I'm collecting the unsafe expression by using <code>db.body(def).exprs.iter()</code> to iterate over all of the exprs in a body, assuming that it's visiting each one individually and that I don't need to do any walking myself.</p>



<a name="198637143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Expr%20within%20expr/near/198637143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Expr.20within.20expr.html#198637143">(May 25 2020 at 06:20)</a>:</h4>
<p>No, I don‘t think we have anything for this,already</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>